package com.resms.saas.producer;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.SpringBootConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.ImportResource;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.io.IOException;

/**
 * Hello world!
 *
 */
@SpringBootApplication
@ImportResource(locations = {"classpath:spring/provider.xml"})
public class Provider
{
    public static void main( String[] args ) throws IOException, InterruptedException {

        System.out.println( "Dubbo Demo Provider" );
        new EmbeddedZooKeeper(2181, false).start();
        // wait for embedded zookeeper start completely.
        Thread.sleep(1000);
        ApplicationContext context = SpringApplication.run(Provider.class,args);

//        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(new String[]{"classpath:spring/provider.xml"});
//        context.start();
        System.in.read(); // 按任意键退出
    }
}
